home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 84 / MacAddict_084_2003_08.iso / mac / Software / Audio & Music / Audacity 1.1.3.dmg / nyquist / bug.lsp next >
Lisp/Scheme  |  2002-09-16  |  2KB  |  56 lines

  1. ; 6 -32 8 -32 pumped too much noise, picked up student answer too
  2. ; 3 -30 4 -30 pumped too much noise too
  3. (setf m (compress-map 2 -12 2 -24 :limit t :transition 2))
  4. (s-save (scale 0.005 m) ny:all "map.wav")
  5.  
  6. (defun t1 () (print (s-save (clip (let (y)
  7.   (setf y (compress (s-read "c:\\rbd\\garlan.aif") m 0.1 0.1))
  8.   (setf y (agc y 6.0 2.0 2.0))
  9.   y) 1.0) ny:all "compress.wav" :bits 8)))
  10.  
  11. (defun t2 () (print (s-save (clip (let (y)
  12.   (setf y (compress (s-read "denoise.wav") m 0.1 0.1))
  13.   (setf y (agc y 6.0 2.0 2.0))
  14.   y) 1.0) ny:all "compden8.wav" :bits 8)))
  15.  
  16. ;(print (play (clip (scale 1.0 (compress (s-read "c:\\rbd\\garlan.aif") m 0.1 0.1)) 1.0)))
  17. ;(print (play (clip (agc (s-read "c:\\rbd\\garlan.aif") 6.0 2.0 2.0) 1.0)))
  18. ;(setf sil (s-read "..\\..\\garlan.aif" :time-offset 7.655 :dur 1.165))
  19. ;(setf soft (s-read "..\\..\\garlan.aif" :time-offset 15.64 :dur .11))
  20.  
  21. ; (play (compress sil m 0.1 0.1))
  22.  
  23. ; (s-save (snd-oneshot (s-read ".\\orig.wav") 0.990 0.1) ny:all "oneshot.wav")
  24.  
  25. (defun square (x) (* x x))
  26.  
  27. ;; region for low-pass will be *soften-width* wide, with
  28. ;; *soften-crossfade* seconds of cross-fade
  29. (setf *soften-width* 0.02)
  30. (setf *soften-crossfade* 0.002)
  31.  
  32. (defun soften-clipping (snd)
  33.   (let (clip-region)
  34.     (setf clip-region (snd-oneshot (prod snd snd) 
  35.                     (square (/ 126.0 127.0)) *soften-width*))
  36.     (setf clip-region (snd-chase clip-region 
  37.                      *soften-crossfade* *soften-crossfade*))
  38.     (setf snd (seq (s-rest 0.01) (cue (scale 0.99 snd))))
  39.     ; (vector (prod snd clip-region) snd)
  40.     (prod snd clip-region)        
  41.   ))
  42.  
  43. (sound-off)
  44.     
  45. (defun tes ()
  46.   (let (snd)
  47.     (setf snd (s-read "..\\..\\intro.aif"))
  48.     (play (soften-clipping snd))))
  49.  
  50. (tes)
  51.  
  52.  
  53.  
  54.  
  55.  
  56.